<template>
    <div class="header">
      <div class="title">
        <!-- <div>山东省耕地保护动态监管工作平台</div> -->
          <img src="../assets/img//logo.png" alt="">
      </div>
      <div class="right_content">
            <div class="hyn">
               <div>姓名:&nbsp;&nbsp;{{userobj.username}}</div>
               <div class="bm">部门:&nbsp;&nbsp;{{userobj.deptname}}</div>
            </div>
            <div class="usname" @click="quit"><a-icon type="logout" />&nbsp;退出</div>
      </div>
    </div>
</template>

<script>
import {menu} from '../data/menu.js';
    export default {
        data(){
            return{
                  userobj:{
                    username:'',
                    deptname:''
                  }
            }
        },
        mounted(){
          setTimeout(() => {
            this.userobj = JSON.parse(localStorage.getItem("user"))
          }, 1000);
         
        },
        methods:{
          //退出
          quit(){
            console.log( this.$store.state.menudata,'this');
            localStorage.clear();
            this.$message.success("退出成功");
             this.$router.push('/login')
          }
        }
    }
</script>

<style lang="less" scoped>
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 50px;
  background-color: #1890ff;
  .title {
    font-size: 25px;
    // line-height: 50px;
    color: white;
  }
  .right_content {
    display: flex;
    align-items: center;
    // margin-top: 10px;
    .hyn {
      color: #ffff;
      font-size: 16px;
      font-family: 微软雅黑;
      line-height: 32px;
      font-weight: bold;
      .bm{
        margin-top: -5px;
      }
    }
    .usname {
      cursor: pointer;
      padding-left: 30px;
      color: #ffff;
      font-size: 16px;
      font-weight: bold;
      font-family: 微软雅黑;
      line-height: 32px;
    }
  }
}
</style>